// 全选的key
export const allCheckedKeys = {
  orchsym: {
    actionLog: ["display"],
    alarmManage: ["display", "alarmStatistics", "alarmUser", "alarmList", "policy"],
    apiManage: ["display", "domain", "bodyModel", "project", "apiLog", "apiSearch", "dashboard", "apiUrl"],
    project: ["display", "d2a", "file", "api", "soap", "integration", "nacos"],
    apiSafe: ["display", "riskmanagement", "strategic", "threatevent", "threatlist", "todayOverview"],
    cmsManage: ["display", "apiDesc", "carouselSetting", "logoSetting", "material", "navigation", "styleSetting"],
    envManage: ["display", "envList"],
    integrationManage: ["display", "d2a", "integration"],
    monitoringCenter: ["display", "overview", "call", "relationShip", "customizeDashboard"],
    portalManage: ["display", "openPortal", "transferStation", "preGrantPortal"],
    test: ["display", "testSuite", "testPlan"],
    partner: ["read", "create", "edit", "delete", "password"],
    userManage: ["read", "create", "edit", "delete", "password", "sourceManage"],
    roleManage: ["read", "create", "edit", "delete", "copy"],
    orgManage: ["read", "create", "edit"],
    licenseManage: ["read"],
    operationManagement: ["read", "monitor", "alert"],
    approve: ["read", "flow", "todo"],
    govern: ["display","portrait","apiStandard","downloadApiReport"],
    cost: ["read", "combo", "order", "bill", "spend", "statistics"],
  },
  runtime: {
    application: ["display"],
    template: ["display"],
    controllerService: ["display"],
    nodeManage: ["display"],
    traceAlert: ["display"],
    recycleBin: ["display"],
    systemManage: ["display"],
    integrationManage: ["display", "orchsymWeb", "orchsymApi"]
  },
  configServer: {
    dashboard: ['display'],
    monitor: ['display', 'SystemResource', 'ConfigOperation', 'RunHistory', 'AlarmNotification'],
    nodeManage: ['display'],
    dataManage: ['display', 'dataSource', 'dataType'],
    templateManage: ['display'],
    systemManage: ['display'],
  }
}

// license所有的checkbox对应的keys
// (每次新增选项必须更新这里的，key是LICENSEENTRIES.submenu.value
// value是LICENSEENTRIES.submenu.value.permissions列表中所有的value)
export const licenseChildKeys: Record<string, string[]> = {
  apiManage: ["apiUrl", "domain", "bodyModel", "project", "apiLog", "apiSearch", "dashboard"],
  integrationManage: ["d2a", "integration"],
  system: ["licenseManage", "orgManage", "userManage", "roleManage"],
  licenseManage: ["read"],
  orgManage: ["read", "create", "edit"],
  userManage: ["read", "create", "edit", "delete", "password", "sourceManage"],
  roleManage: ["read", "create", "edit", "delete", "copy"],
  project: ["d2a", "file", "integration", "api", "soap", "nacos", "zookeeper", "eureka"],
  alarmManage: ["alarmStatistics", "alarmUser", "alarmList", "policy"],
  portalManage: ["openPortal", "preGrantPortal", "partnerManage", "transferStation"],
  partner: ["read", "create", "edit", "delete", "password"],
  menu: [],
  envManage: ["envList"],
  cmsManage: ["navigation", "logoSetting", "material", "apiDesc", "carouselSetting", "styleSetting"],
  apiSafe: ["todayOverview", "threatlist", "strategic", "riskmanagement", "threatevent"],
  monitoringCenter: ["overview", "call", "relationShip", "customizeDashboard"],
  test: ["testSuite", "testPlan"],
  operationManagement: ["read", "monitor", "alert"],
  approve: ["read", "flow", "todo"],
  govern: ["display","portrait", "apiStandard","downloadApiReport"],
  cost: ["combo", "order", "bill", "spend", "statistics"],
}

export const LICENSEENTRIES = [
  {
    submenu: [
      {
        label: "操作记录",
        value: "actionLog",
        permissions: [{label: "显示操作记录菜单", value: "display"}]
      }
    ]
  },
  {
    label: "告警管理",
    value: "alarmManage",
    menubar: [],
    submenu: [
      {
        label: "告警管理",
        value: "alarmManage",
        permissions: [
          {label: "显示告警管理菜单", value: "display"},
          {label: "告警列表", value: "alarmList"},
          {label: "告警统计", value: "alarmStatistics"},
          {label: "策略管理", value: "policy"},
          {label: "告警人员管理", value: "alarmUser"}
        ]
      }
    ]
  },
  {
    label: "API管理",
    value: "apiManage",
    menubar: [],
    submenu: [
      {
        label: "API管理",
        value: "apiManage",
        permissions: [
          {label: "显示项目管理菜单", value: "display"},
          {label: "API日志管理", value: "apiLog"},
          {label: "API搜索", value: "apiSearch"},
          {label: "API地址管理", value: "apiUrl"},
          {label: "Body模型管理", value: "bodyModel"},
          {label: "仪表盘", value: "dashboard"},
          {label: "域名管理", value: "domain"},
          {label: "项目管理", value: "project"}
        ]
      }
    ]
  },
  {
    label: "项目类型",
    value: "project",
    menubar: [],
    submenu: [
      {
        label: "项目类型",
        value: "project",
        permissions: [
          {label: "允许创建项目类型", value: "display"},
          {label: "D2A", value: "d2a"},
          {label: "代理已有API", value: "api"},
          {label: "文件导入", value: "file"},
          {label: "编排", value: "integration"},
          {label: "注册中心", value: "nacos"},
          {label: "SOAP", value: "soap"}
        ]
      }
    ]
  },
  {
    label: "API安全管理",
    value: "apiSafe",
    menubar: [],
    submenu: [
      {
        label: "API安全管理",
        value: "apiSafe",
        permissions: [
          {label: "显示安全管理菜单", value: "display"},
          {label: "风险处置", value: "riskmanagement"},
          {label: "策略管理", value: "strategic"},
          {label: "威胁事件统计", value: "threatevent"},
          {label: "威胁事件列表", value: "threatlist"},
          {label: "今日总览", value: "todayOverview"}
        ]
      }
    ]
  },
  {
    label: "开放平台",
    value: "cmsManage",
    menubar: [],
    submenu: [
      {
        label: "开放平台",
        value: "cmsManage",
        permissions: [
          {label: "显示开放平台菜单", value: "display"},
          {label: "API详情设置", value: "apiDesc"},
          {label: "轮播图设置", value: "carouselSetting"},
          {label: "Logo设置", value: "logoSetting"},
          {label: "素材内容管理", value: "material"},
          {label: "导航菜单", value: "navigation"},
          {label: "样式设置", value: "styleSetting"}
        ]
      }
    ]
  },
  {
    label: "环境管理",
    value: "envManage",
    menubar: [],
    submenu: [
      {
        label: "环境管理",
        value: "envManage",
        permissions: [
          {label: "显示环境管理菜单", value: "display"},
          {label: "环境列表", value: "envList"}
        ]
      }
    ]
  },
  {
    label: "集成管理",
    value: "integrationManage",
    menubar: [],
    submenu: [
      {
        label: "集成管理",
        value: "integrationManage",
        permissions: [
          {label: "显示集成管理菜单", value: "display"},
          {label: "D2A管理", value: "d2a"},
          {label: "编排管理", value: "integration"}
        ]
      }
    ]
  },
  {
    label: "监控中心",
    value: "monitoringCenter",
    menubar: [],
    submenu: [
      {
        label: "监控中心",
        value: "monitoringCenter",
        permissions: [
          {label: "显示监控中心菜单", value: "display"},
          {label: "租户总览", value: "overview"},
          {label: "调用统计", value: "call"},
          {label: "资产关系图", value: "relationShip"},
          {label: "自定义仪表盘", value: "customizeDashboard"}
        ]
      }
    ]
  },
  {
    label: "门户管理",
    value: "portal",
    menubar: [],
    submenu: [
      {
        label: "门户管理",
        value: "portalManage",
        permissions: [
          {label: "显示门户管理菜单", value: "display"},
          {label: "开放门户管理", value: "openPortal"},
          {label: "预授权门户管理", value: "preGrantPortal"},
          {label: "应用中转站", value: "transferStation"}
        ]
      }
    ]
  },
  {
    label: "测试中心",
    value: "test",
    menubar: [],
    submenu: [
      {
        label: "测试中心",
        value: "test",
        permissions: [
          {label: "显示测试中心菜单", value: "display"},
          {label: "测试套件", value: "testSuite"},
          {label: "测试计划", value: "testPlan"}
        ]
      }
    ]
  },
  {
    label: "合作伙伴管理",
    value: "partner",
    menubar: [],
    submenu: [
      {
        label: "合作伙伴管理",
        value: "partner",
        permissions: [
          {label: "查看合作伙伴及菜单", value: "read"},
          {label: "创建合作伙伴", value: "create"},
          {label: "编辑合作伙伴", value: "edit"},
          {label: "删除伙伴", value: "delete"},
          {label: "修改密码", value: "password"}
        ]
      }
    ]
  },
  {
    label: "系统设置",
    value: "system",
    menubar: [
      // { label: '显示API安全管理菜单', value: 'display' },
    ],
    submenu: [
      {
        label: "账号管理",
        value: "userManage",
        permissions: [
          {label: "查看账号及菜单", value: "read"},
          {label: "创建账号", value: "create"},
          {label: "编辑账号", value: "edit"},
          {label: "删除账号", value: "delete"},
          {label: "修改密码", value: "password"},
          {label: "资源分配", value: "sourceManage"}
        ]
      },
      {
        label: "角色管理",
        value: "roleManage",
        permissions: [
          {label: "查看角色及菜单", value: "read"},
          {label: "创建角色", value: "create"},
          {label: "编辑角色", value: "edit"},
          {label: "删除角色", value: "delete"},
          {label: "复制角色", value: "copy"}
        ]
      },
      {
        label: "租户管理",
        value: "orgManage",
        permissions: [
          {label: "查看租户及菜单", value: "read"},
          {label: "创建租户", value: "create"},
          {label: "编辑租户", value: "edit"}
        ]
      },
      {
        label: "License管理",
        value: "licenseManage",
        permissions: [{label: "显示License管理菜单", value: "read"}]
      }
    ]
  },
  {
    label: "运维管理",
    value: "devops",
    menubar: [
      // { label: '显示运维管理菜单', value: 'display' },
    ],
    submenu: [
      {
        label: "运维管理",
        value: "operationManagement",
        permissions: [
          {label: "显示运维管理菜单", value: "read"},
          {label: "运维监控", value: "monitor"},
          {label: "运维告警", value: "alert"}
        ]
      }
    ]
  },
  {
    label: "审批管理",
    value: "approve",
    menubar: [],
    submenu: [
      {
        label: "审批管理",
        value: "approve",
        permissions: [
          {label: "显示审批管理菜单", value: "read"},
          {label: "审批流程", value: "flow"},
          {label: "审批待办", value: "todo"}
        ]
      }
    ]
  },
  {
    label: "API治理",
    value: "govern",
    menubar: [],
    submenu: [{
      label: "API治理",
      value: "govern",
      permissions: [
        {label: "显示API治理菜单", value: "display"},
        {label: "显示API画像菜单", value: "portrait"},
        {label: "规范管理菜单", value: "apiStandard"},
        {label: "下载API现状报表", value: "downloadApiReport"},
      ],
    }],
  }, {
    label: "计费管理",
    value: "cost",
    menubar: [],
    submenu: [{
      label: "计费管理",
      value: "cost",
      permissions: [
        {label: "显示计费管理菜单", value: "read"},
        {label: "套餐管理", value: "combo"},
        {label: "订单管理", value: "order"},
        {label: "账单管理", value: "bill"},
        {label: "成本管理", value: "spend"},
        {label: "数据统计", value: "statistics"},
      ],
    }],
  },
]

export const RUNTIMELICENSEENTRIES = [
  {
    submenu: [
      {
        label: "应用管理",
        value: "application",
        permissions: [{label: "显示应用管理菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "模版管理",
        value: "template",
        permissions: [{label: "显示模版管理菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "服务管理",
        value: "controllerService",
        permissions: [{label: "显示服务管理菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "节点管理",
        value: "nodeManage",
        permissions: [{label: "显示节点管理菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "流程告警",
        value: "traceAlert",
        permissions: [{label: "显示流程告警菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "回收站",
        value: "recycleBin",
        permissions: [{label: "显示回收站菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "系统管理",
        value: "systemManage",
        permissions: [{label: "显示系统管理菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "集成管理",
        value: "integrationManage",
        permissions: [
          {label: "显示集成管理菜单", value: "display"},
          {label: "显示管理平台入口", value: "orchsymWeb"},
          {label: "显示API开放平台入口", value: "orchsymApi"}
        ]
      }
    ]
  }
]


export const CONFIGSERVERLICENSEENTRIES = [
  {
    submenu: [
      {
        label: "仪表盘",
        value: "dashboard",
        permissions: [{label: "显示仪表盘菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "监控中心",
        value: "monitor",
        permissions: [
          {label: "显示监控中心菜单", value: "display"},
          {label: "系统资源监控", value: "SystemResource"},
          {label: "配置运行监控", value: "ConfigOperation"},
          {label: "配置运行历史", value: "RunHistory"},
          {label: "告警通知中心", value: "AlarmNotification"},
        ]
      }
    ]
  },
  {
    submenu: [
      {
        label: "节点管理",
        value: "nodeManage",
        permissions: [{label: "显示节点管理菜单", value: "display"}]
      }
    ]
  },
  {
    submenu: [
      {
        label: "数据源管理",
        value: "dataManage",
        permissions: [
          {label: "显示数据源管理菜单", value: "display"},
          {label: "数据源类型", value: "dataType"},
          {label: "数据源", value: "dataSource"},
        ]
      }
    ]
  },
  {
    submenu: [
      {
        label: "配置模板管理",
        value: "templateManage",
        permissions: [{label: "显示配置模板管理菜单", value: "display"}]
      }
    ]
  }
]
